gov.nist.antd.optical
Class ONIC

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.Net.NIC
              |
              +--SSF.Net._NIC
                    |
                    +--gov.nist.antd.optical.ONIC
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable, FailureInformation

public class ONIC
extends _NIC

Optical Network Interface Card. This class is the optical representation to the NIC in SSFNet. The OXC and optical routers use it. This class is primary for the use with a Router to provide optical capabilities and with an OXC.

 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

Nested Class Summary
 
Nested classes inherited from class SSF.Net._NIC
 
Field Summary
private  double ber
          The Bit Error Rate.
protected static boolean DEBUG
          For debug purposes of all ONICS (use in dml: DEBUG true).
private  java.util.Vector ipAddresses
          List of IP address for this ONIC.
private  double jitter
          To avoid peacks during the transmission.
 
Fields inherited from class SSF.Net._NIC
defaultFailureModuleName, inConfiguration, inPacketBytes, outPacketBytes, outPacketCount, prevInPacketBytes, prevOutPacketBytes, prevOutPacketCount
 
Fields inherited from class SSF.Net.NIC
attachedProtocol, BIT_RATE, buffersize, CHECK_FOR_SYNS, COUNT_FLAKY_DROPS, DEFAULT_BIT_RATE, DEFAULT_BUFFERSIZE, DEFAULT_DELAY, DEFAULT_FLAKINESS, DELAY, FLAKINESS, flakyDrops, flakyGen, FREQUENCY, ID, ifaceUp, IN, ipAddr, isVirtual, link_hw, maskBits, OUT, queueManager, queueMonitor, receiver
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
ONIC(ProtocolGraph g, int use_id)
          Default constructor.
 
Method Summary
protected  void checkLightStatus(FailureInformation component)
          Deprecated. use the method checkLinkStatus (FailureInformation) instead.
protected  void checkLinkStatus(FailureInformation component)
          This method will be called to detect a failure or a recovery of components.
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure the ONIC.
 double getAvailableBandwidth()
          Determines the available bandwith that can be used to send a package.
 double getBer()
          Get the Bite Error Rate of this ONIC.
 long getBufferSize()
          return the size of the buffer.
 double getDelay()
          Get the Delay of this ONIC in seconds.
 Fiber getFiber(int id)
          Returns the specified fiber.
 Fiber getFiberofPort(int port)
          Returns the fiber that has this port number.
 Fiber[] getFibers()
          Returns all fibers.
 int getID()
          Get the Id of this ONIC.
 Fiber[] getInFibers()
          Returns all incomming fibers of this ONIC.
 int getIP()
          Gives the IP adress of the ONIC
 double getJitter()
          Get the Jitter of this ONIC.
 OpticalLinkLayer getLinkLayer()
          get the optical link layer attached to this ONIC
 double getMaxBandwidth()
          Determines the maximum bandwith that can be used to send a package.
 ONIC getOppositeONIC()
          Determine the ONIC on the other side of the link.
 Fiber[] getOutFibers()
          Return all outgoing fibers.
 packetQueue getPacketQueue()
          Return the queue of this ONIC
 java.util.Vector getVectorOfInFibers()
          Returns all incomming fibers of this ONIC.
 java.util.Vector getVectorOfOutFibers()
          Returns all outgoing fibers of this ONIC.
 void init()
          Initializes the ONIC.
 java.lang.String ipAddrString()
          Return the complete CIDR-compliant address of this NIC.
 boolean isInFiber(Fiber fiber)
          Determines if the fiber is an input fiber.
 boolean isInFiber(int id)
          Determines if the fiber is an input fiber.
 boolean isOutFiber(Fiber fiber)
          Determines if the fiber is an output fiber.
 boolean isOutFiber(int id)
          Determines if the fiber is an output fiber.
 boolean isOwnIP(int ip)
          Determines if the ip is own by this ONIC.
 boolean isPortIDinUse(int portID)
          Determines if the given portID is used in this ONIC.
private  void notifyONIC()
          Notifies the opposite ONIC for the failed ONIC.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Similar to SSF.
 void setBer(double ber)
          Set the Bite Error Rate
 void setDelay(double delay)
          Set the delay in seconds.
 void setFailure(boolean newValue)
          Set and reset the failure value.
static void setGlobalDebug(boolean globalDebug)
          Set the debug-mode of all ONICs.
 void setID(int id)
          Set the ID.
 void setJitter(double jitter)
          Set the jitter for this ONIC.
 java.lang.String toString()
          Return information about this ONIC.
 
Methods inherited from class SSF.Net._NIC
configFailureModule, debug, getBandwidth, getFailureModule, getInPacketBytes, getInPacketCount, getInterfaceInfo, getInterfaceType, getOutPacketBytes, getOutPacketCount, getTcpDump, isDebug, isFailure, isGlobalDebug, isIfaceUp, isLSRInterface, isMessageMonitor, prepareTimer, processOutMessage, processPacketEvent, registerForFailure, sendMessage, setFailureModule, setInterfaceInfo, setInterfaceType, setLSRInterface, setMessageMonitor
 
Methods inherited from class SSF.Net.NIC
bitrate, close, delay, down, drop_flaky, drop, frequency, interfaceIdentifier, isUp, open, up
 
Methods inherited from class SSF.OS.ProtocolSession
closed, debugIdentifier, inGraph, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

protected static boolean DEBUG
For debug purposes of all ONICS (use in dml: DEBUG true).


ber

private double ber
The Bit Error Rate. (Default = 1E-9)


jitter

private double jitter
To avoid peacks during the transmission. (Default = 0.0)


ipAddresses

private java.util.Vector ipAddresses
List of IP address for this ONIC.

Constructor Detail

ONIC

public ONIC(ProtocolGraph g,
            int use_id)
     throws ProtocolException
Default constructor.

Parameters:
g - The protocol graph attached to this ONIC.
use_id - The id to use for this ONIC.
Throws:
ProtocolException
Method Detail

setGlobalDebug

public static final void setGlobalDebug(boolean globalDebug)
Set the debug-mode of all ONICs.

Parameters:
globalDebug - Set the global debug mode.
Since:
2.3

config

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

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class _NIC
Parameters:
cfg - The configuration object.
Throws:
com.renesys.raceway.DML.configException

getBer

public double getBer()
Get the Bite Error Rate of this ONIC.

Returns:
The attribute ber.

getDelay

public double getDelay()
Get the Delay of this ONIC in seconds. To determine the delay in ticks use the method delay()

Returns:
The attribute delay.

getID

public int getID()
Get the Id of this ONIC.

Returns:
The attribute ID.

getJitter

public double getJitter()
Get the Jitter of this ONIC.

Returns:
The attribute jitter.

ipAddrString

public java.lang.String ipAddrString()
Return the complete CIDR-compliant address of this NIC.

Overrides:
ipAddrString in class NIC
Returns:
The ip address.

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
Similar to SSF.

Overrides:
push in class _NIC
Parameters:
message - The message to push.
fromSession - The sender of the message.
Returns:
True if the message is pushed. False if it is dropped.

setBer

public void setBer(double ber)
Set the Bite Error Rate

Parameters:
ber - The new value.

setDelay

public void setDelay(double delay)
Set the delay in seconds.

Parameters:
delay - The new value.

setID

public void setID(int id)
Set the ID.

Parameters:
id - The id.

setJitter

public void setJitter(double jitter)
Set the jitter for this ONIC.

Parameters:
jitter - The new value.

setFailure

public void setFailure(boolean newValue)
Set and reset the failure value.

Overrides:
setFailure in class _NIC
Parameters:
newValue - the new failure value.

getLinkLayer

public OpticalLinkLayer getLinkLayer()
get the optical link layer attached to this ONIC

Returns:
The optical link layer

toString

public java.lang.String toString()
Return information about this ONIC.

Overrides:
toString in class NIC
Returns:
The informations on this ONIC.

getInFibers

public Fiber[] getInFibers()
Returns all incomming fibers of this ONIC.

Returns:
An array of incomming fibers or an empty array of the length == 0.

getVectorOfInFibers

public java.util.Vector getVectorOfInFibers()
Returns all incomming fibers of this ONIC.

Returns:
A vector of incomming fibers.

getOutFibers

public Fiber[] getOutFibers()
Return all outgoing fibers.

Returns:
An array of outgouing fibers of an empty array of the length==0

getVectorOfOutFibers

public java.util.Vector getVectorOfOutFibers()
Returns all outgoing fibers of this ONIC.

Returns:
A vector of outgoing fibers.

getFiber

public Fiber getFiber(int id)
Returns the specified fiber.

Parameters:
id - the id of the fiber.
Returns:
the fiber or null if the fiber does not exist.

getFiberofPort

public Fiber getFiberofPort(int port)
Returns the fiber that has this port number.

Parameters:
port - The port number of the requested fiber.
Returns:
the fiber or null if the fiber does not exist.

getFibers

public Fiber[] getFibers()
Returns all fibers.

Returns:
an array containig all fibers or an array of the length==0.

isInFiber

public boolean isInFiber(int id)
Determines if the fiber is an input fiber.

Parameters:
id - the id of the fiber.
Returns:
true if the fiber is an input fiber.

isInFiber

public boolean isInFiber(Fiber fiber)
Determines if the fiber is an input fiber.

Parameters:
fiber - the fiber we want to check the direction.
Returns:
true if the fiber is an input fiber.

isOutFiber

public boolean isOutFiber(int id)
Determines if the fiber is an output fiber.

Parameters:
id - the id of the fiber.
Returns:
true if the fiber is an output fiber.

isOutFiber

public boolean isOutFiber(Fiber fiber)
Determines if the fiber is an output fiber.

Parameters:
fiber - the fiber we want to check the direction.
Returns:
true if the fiber is an output fiber.

isOwnIP

public boolean isOwnIP(int ip)
Determines if the ip is own by this ONIC.

Parameters:
ip - the IP adress to check.
Returns:
true if the ip adress is own by this ONIC.

getIP

public int getIP()
Gives the IP adress of the ONIC

Returns:
the attribute ipAddr.

isPortIDinUse

public boolean isPortIDinUse(int portID)
                      throws IllegalIDException
Determines if the given portID is used in this ONIC.

Parameters:
portID - the portID which will be looked for.
Returns:
true if the ID is in use, otherwise false.
Throws:
IllegalIDException - the given id is an illegal id.

getBufferSize

public long getBufferSize()
return the size of the buffer.

Returns:
The size of the buffer.

getMaxBandwidth

public double getMaxBandwidth()
Determines the maximum bandwith that can be used to send a package. This method includes the used and non used bandwidth.

Returns:
Returns the bandwidth of all out going fibers.

getAvailableBandwidth

public double getAvailableBandwidth()
Determines the available bandwith that can be used to send a package. This method only includes non used bandwidth.

Returns:
Returns the non used bandwidth of all out going fibers.

checkLightStatus

protected void checkLightStatus(FailureInformation component)
Deprecated. use the method checkLinkStatus (FailureInformation) instead.

This method will be called to detect a failure or a recovery of components.

Parameters:
component - The failed or recovered module.

checkLinkStatus

protected void checkLinkStatus(FailureInformation component)
This method will be called to detect a failure or a recovery of components. This method overrides the method checkLinkStatus of the superclass to make it visible in the optical package.

Overrides:
checkLinkStatus in class _NIC
Parameters:
component - The failed or recovered module.
Since:
2.10

notifyONIC

private void notifyONIC()
Notifies the opposite ONIC for the failed ONIC.

Since:
2.2

getOppositeONIC

public ONIC getOppositeONIC()
Determine the ONIC on the other side of the link. If the ONIC is virtual the other side does not exist and the result is null.

Returns:
the ONIC on the other side.

init

public void init()
          throws ProtocolException
Initializes the ONIC. This method scanns all lambdas for failures and detects them. After that it processes the fibers, the link and the opposite ONIC.

Overrides:
init in class _NIC
Throws:
ProtocolException - when an error occured.
Since:
2.2

getPacketQueue

public packetQueue getPacketQueue()
Return the queue of this ONIC

Returns:
The queue