gov.nist.antd.optical
Class OpticalLinkLayer

java.lang.Object
  |
  +--com.renesys.raceway.SSF.Entity
        |
        +--gov.nist.antd.optical.OpticalLinkLayer
All Implemented Interfaces:
linkLayer

public class OpticalLinkLayer
extends com.renesys.raceway.SSF.Entity
implements linkLayer

The class represents the optical link layer of a point to point connection. it is similar to the class ptpLinkLayer in SSFNet. An OXC and LSR only can be connected to this kind of linkLayer in lieu of the regular linkLayer classes delivered by the standard SSFNet.
This linklayer connects two ONICS with each other. Each ONIC has two out and one in channel. Both outchannels will be connected to the same in channel with the following setup:
regular out <-> in - mapping with link delay + onic delay
peer out <-> in - mapping with link delay
The peer out will only be used for ONIC peer status delivery. This messages don't show up in regular message handling, they will be processed without push to the upper layer. They also do not appear in any monitor.

 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.

Version:
2.0

 VERSION CONTROL
 -----------------------------------------------------------------------------
 Name     - YYYY/MM/DD - VERSION - ACTION
 rouil    - 2001/05/29 - 1.0     - Source created.
 rouil    - 2002/03/12 - 1.1     - Added LSR type in constructor. Depending
                                   on the type the attached protocol is 
                                   diferent.
 borchert - 2002/09/28 - 2.0     - Added peer channel to enable communication
                                   between ONIC entities. The channel delay
                                   is == linkdelay.
 

Author:
borchert
, rouil

Nested Class Summary
(package private)  class OpticalLinkLayer.ptpPeerEnumeration
           
 
Field Summary
private  ONIC[] ends
          The 2 ONICs attached to this link layer.
private  OpticalLink forLink
          The link attached to this link layer.
 
Fields inherited from class com.renesys.raceway.SSF.Entity
 
Constructor Summary
OpticalLinkLayer(OpticalLink olnk)
          Constructs an optical linklayer
 
Method Summary
 ONIC[] getEnds()
          Number of interfaces constructed for this Host (may not all be "up")
 OpticalLink getForLink()
          Return OpticalLink attached to this OpticalLinkLayer.
protected  com.renesys.raceway.SSF.inChannel in(ONIC fromNIC)
          Return the input channel of the requested ONIC
 link onLink()
          Return OpticalLink attached to this OpticalLinkLayer.
 NIC peer(NIC forNIC)
          Deprecated. use peer(ONIC) instead of peer(NIC).
 ONIC peer(ONIC forNIC)
          Return the peer ONIC managed by this optical link layer.
 java.util.Enumeration peers(NIC forNIC)
          Deprecated. use peers(ONIC) instead of peers(NIC).
 java.util.Enumeration peers(ONIC forNIC)
          Return the peer ONICs managed by this optical link layer.
 com.renesys.raceway.SSF.Event[] receive(NIC forNIC)
          Deprecated. use receive(ONIC) instead of receive(NIC).
 com.renesys.raceway.SSF.Event[] receive(ONIC forNIC)
          Poll the optical link layer for any packets available for receipt
 void setEnds(ONIC[] newEnds)
          Set the attached ONICs managed by this optical link layer.
 void setForLink(OpticalLink olnk)
          Set the OpticalLink attached to this OpticalLinkLayer.
 void transmit(NIC forNIC, PacketEvent pevt, long qdelay)
          Deprecated. use transmit(ONIC) instead of transmit(NIC).
 void transmit(ONIC forNIC, PacketEvent pevt, long qdelay)
          Send a packet with the given queueing delay.
 void up(NIC nic)
          Deprecated. use in(ONIC) instead of in(NIC).
 void up(ONIC nic)
          Bring up the given ONIC over this optical link layer.
 
Methods inherited from class com.renesys.raceway.SSF.Entity
alignment, alignTo, coalignedEntities, inChannels, init, joinAll, makeIndependent, now, outChannels, pauseAll, playRole, processes, reset, resumeAll, startAll, startAll, startClient, startClient, startServer, wx, Yx
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

forLink

private OpticalLink forLink
The link attached to this link layer.


ends

private ONIC[] ends
The 2 ONICs attached to this link layer.

Constructor Detail

OpticalLinkLayer

public OpticalLinkLayer(OpticalLink olnk)
Constructs an optical linklayer

Parameters:
olnk - The attached link.
Method Detail

getEnds

public ONIC[] getEnds()
Number of interfaces constructed for this Host (may not all be "up")

Returns:
The attached onic.

setEnds

public void setEnds(ONIC[] newEnds)
Set the attached ONICs managed by this optical link layer.

Parameters:
newEnds - The array of attached ONICs

in

protected com.renesys.raceway.SSF.inChannel in(ONIC fromNIC)
Return the input channel of the requested ONIC

Parameters:
fromNIC - The ONIC we need the input channel.
Returns:
The requested input channel.

getForLink

public OpticalLink getForLink()
Return OpticalLink attached to this OpticalLinkLayer.

Returns:
The managed optical link.

setForLink

public void setForLink(OpticalLink olnk)
Set the OpticalLink attached to this OpticalLinkLayer.

Parameters:
olnk - The opticalLink

onLink

public link onLink()
Return OpticalLink attached to this OpticalLinkLayer.

Specified by:
onLink in interface linkLayer
Returns:
The managed optical link.

peer

public ONIC peer(ONIC forNIC)
Return the peer ONIC managed by this optical link layer.

Parameters:
forNIC - One of the ONICs managed by the optical link layer.
Returns:
The peer ONIC.

peer

public NIC peer(NIC forNIC)
Deprecated. use peer(ONIC) instead of peer(NIC).

Use peer(ONIC) instead of peer(NIC).

Parameters:
forNIC - One of the ONICs managed by the optical link layer.
Returns:
The peer NIC.

peers

public java.util.Enumeration peers(NIC forNIC)
Deprecated. use peers(ONIC) instead of peers(NIC).

Use peers(ONIC) instead of peers(NIC).

Specified by:
peers in interface linkLayer
Parameters:
forNIC - One of the ONICs managed by the optical link layer.

peers

public java.util.Enumeration peers(ONIC forNIC)
Return the peer ONICs managed by this optical link layer.

Parameters:
forNIC - One of the ONICs managed by the optical link layer.
Returns:
the peer ONICs.

receive

public com.renesys.raceway.SSF.Event[] receive(NIC forNIC)
Deprecated. use receive(ONIC) instead of receive(NIC).

Use receive(ONIC) instead of receive(NIC).

Specified by:
receive in interface linkLayer
Parameters:
forNIC - One of the ONICs managed by the optical link layer.
Returns:
The list of events on this NIC.

receive

public com.renesys.raceway.SSF.Event[] receive(ONIC forNIC)
Poll the optical link layer for any packets available for receipt

Parameters:
forNIC - One of the ONICs managed by the optical link layer.
Returns:
The packets available for receipt.

transmit

public void transmit(NIC forNIC,
                     PacketEvent pevt,
                     long qdelay)
Deprecated. use transmit(ONIC) instead of transmit(NIC).

Use transmit(ONIC) instead of transmit(NIC). Send a packet with the given queueing delay.

Specified by:
transmit in interface linkLayer
Parameters:
forNIC - One of the ONICs managed by the optical link layer.
pevt - The packet event to be sent.
qdelay - The delay before transmission.

transmit

public void transmit(ONIC forNIC,
                     PacketEvent pevt,
                     long qdelay)
Send a packet with the given queueing delay.

Parameters:
forNIC - One of the ONICs managed by the optical link layer.
pevt - The packet event to be sent.
qdelay - The delay before transmission.

up

public void up(NIC nic)
Deprecated. use in(ONIC) instead of in(NIC).

Use in(ONIC) instead of in(NIC). Bring up the given NIC over this link layer.

Specified by:
up in interface linkLayer
Parameters:
nic - The ONIC to be put over this optical link layer.

up

public void up(ONIC nic)
Bring up the given ONIC over this optical link layer. Connect also the peer communication channels. Here use only the link delay, no nic delay.

Parameters:
nic - The ONIC to be put over this optical link layer.