SSF.OS.OSPFv2
Class Interface

java.lang.Object
  |
  +--SSF.OS.OSPFv2.Interface
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class Interface
extends java.lang.Object
implements com.renesys.raceway.DML.Configurable

An OSPF interface.


Nested Class Summary
 class Interface.BeforeElectionTimer
          /* The BeforeElectionTimer waits for an HelloPacket which tells the interface who is DR and BDR.
 class Interface.DelayedAckTimer
          The DelayedAckTimer is started if a new LS Ack Packet should be sent delayed.
 class Interface.PacingTimer
          A timer used to pace LS Update Packets when first flooded out this interface.
 class Interface.SendNewHelloTimer
          /* The Inactivity Timer for this Interface class.
 
Field Summary
 Interface.DelayedAckTimer ackTimer
          A timer that delays sending of Acknowledgment Packets.
 java.lang.String as_nh
          A reference to the as_nh of the OSPF session above
 int backupDesigRouter
          The Backup Designated Router for the network to which the interface is attached.
static int BDR
          Indicates that the Interface is the Backup Designated Router.
static byte BROADCAST
          Indicates that the link type the interface is connected to is broadcast.
 int cost
          cost of this interface
 long delAckTime
          The interval in seconds the router will wait before it sends an delayed Acknowledgment to all Neighbors of this Interface.
 int desigRouter
          The Designated Router for the network to which the interface is attached.
static int DOWN
          Indicates that the Interface is down.
static int DR
          Indicates that the Interface is the Designated Router.
static int DROTHER
          Indicates that the Interface is nor DR neither BDR.
static int ELECTION
          Indicates that the Interface is in election phase.
 int helloInterval
          The period, in seconds, between transmissions of Hello packets on the interface.
 Interface.SendNewHelloTimer helloTimer
          A timer that is set to helloInterval.
 java.lang.Integer id
          The Interface id.
 int ipaddr
          The ip address of the interface.
 int ipmask
          The ip mask of the Interface.
static int LOOPBACK
          Indicates that the Interface is looped back.
 LS_AckPacket lsAckContent
          The content of an LS Ack Packet.
 AreaData myArea
          A link to the Area Data Structure this Interface belongs to.
 OSPF myOSPF
          A link to the OSPF ProtocolSession this Interface belongs to.
static byte NBMA
          Indicates that the link type the interface is connected to is non broadcast multi access.
 java.util.HashMap neighbors
          A list of neighbor data structures containing information about the relationship to the neighbors.
 byte networkType
          The network type the interface is connected to (ptp, broadcast, nbma, ptm).
 java.util.HashMap pacingLSAList
          A list of LSAs that must be flooded out this interface, but are not allowed to send out immediately due to the PacingTimer.
 Interface.PacingTimer pacingTimer
          A timer that controls the rate at which LS Update packets are transmitted out this interface.
static int POINT2POINT
          Indicates that the Interface is in point-to-point state.
static byte PTM
          Indicates that the link type the interface is connected to is point-to-multipoint.
static byte PTP
          Indicates that the link type the interface is connected to is point-to-point.
 int routerDeadInterval
          The period, in seconds, that the router will wait to hear a Hello from a neighbor on the network to which the interface is connected before declaring the neighbor down.
 int routerPrio
          Priority of the router the interface is attached to.
 java.lang.String rtrnh
          A reference to the nh of the OSPF session above
 long rxmtInterval
          The period, in seconds, the router will wait between retransmissions of OSPF-Packets that have not been acknowledged.
 int state
          The actual state of the Interface (down, loopback, waiting,...)
 int transDelay
          The seconds by which LSAs exiting the interface will have their age incremented.
static byte VL
          Indicates that the link type the interface is connected to is virtual-link.
static int WAITING
          Indicates that the Interface is waiting for a Hello with DR and DBR identification.
 Interface.BeforeElectionTimer waitTimer
          A Wait Timer which will wait for routerDeadInterval seconds before either beginning an election of DR and BDR, or receiving an incoming Hello Packet which advertises DR and BDR.
 
Constructor Summary
Interface(OSPF myOSPF, AreaData myArea, com.renesys.raceway.DML.Configuration cfg)
          Constructs a new Interface.
 
Method Summary
 void clearLSAFromRetrLists(java.lang.String key)
          clears a particular LSA from every Neighbors link state retransmission list.
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure the OSPF interface parameters at the start and during the run by configUpdateMessage.
 void configRest(java.util.Enumeration peers)
          Additional configuration to the interface.
 void delayedAcknowledge(LSA ackLSA)
          called if a new LSA should be delayed acknowledged.
 void init()
          Start the ospf session on this interface (just call method "interfaceUp()").
 void interfaceDown()
          Used by Lower-level protocols to indicate that the network interface is no longer functional.
 void interfaceUp()
          Used by the Area Data Structure this Interface belongs to.
 void killNeighbor(int ipaddress)
          Used to destroy a neighbor connection associated with the interface.
 void loopInd()
          Used by Lower-level protocols and network management to indicate that the network interface is now looped back to itself.
 void printConfiguration()
          print current configuration of the interface if necessary.
 void receivedDDPacket(Packet dataDescPkt, java.lang.Integer sourceIP)
          When the Area Data Structure, this Interface belongs to, gets a Database Description Packet, it will call this method to further process it.
 void receivedHello(Packet helloPkt, int sourceIP)
          When the Area Data Structure above gets a Hello Packet, it will call this method of the ospf interface which is associated with the NIC on which the packet has come in.
 void receivedLSAck(Packet lsAckPkt, java.lang.Integer sourceIP)
          When the Area Data Structure, this Interface belongs to, gets a Link State Acknowledgment Packet it calls this method to further process the Packet.
 void receivedLSRequest(Packet lsReqPkt, java.lang.Integer sourceIP)
          When the Area Data Structure of this Interface gets a Link State Request Packet it calls this method to further process the Packet.
 void receivedLSUpdate(Packet lsUpdPkt, java.lang.Integer sourceIP)
          When the Area Data Structure, this Interface belongs to, gets a Link State Update Packet it calls this method to further process the Packet.
 void reset()
          Reset the Interface Data Structure.
 void setArea(AreaData newArea)
          When this Interface changes its Area, this method should be called to set the links to the Area Data Structure to the new Area.
 java.lang.String toMinString()
          Converts the interface to a string using a briefer format than toString.
 java.lang.String toMinString(boolean usenhi)
          Converts the interface to a string using a briefer format than toString.
 java.lang.String toString()
          Converts the Interface to a string.
 void unloopInd()
          Used by Lower-level protocols and network management to indicate that the network interface is no longer looped back to itself.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DOWN

public static final int DOWN
Indicates that the Interface is down.

See Also:
Constant Field Values

LOOPBACK

public static final int LOOPBACK
Indicates that the Interface is looped back.

See Also:
Constant Field Values

POINT2POINT

public static final int POINT2POINT
Indicates that the Interface is in point-to-point state.

See Also:
Constant Field Values

WAITING

public static final int WAITING
Indicates that the Interface is waiting for a Hello with DR and DBR identification.

See Also:
Constant Field Values

ELECTION

public static final int ELECTION
Indicates that the Interface is in election phase.

See Also:
Constant Field Values

DR

public static final int DR
Indicates that the Interface is the Designated Router.

See Also:
Constant Field Values

BDR

public static final int BDR
Indicates that the Interface is the Backup Designated Router.

See Also:
Constant Field Values

DROTHER

public static final int DROTHER
Indicates that the Interface is nor DR neither BDR.

See Also:
Constant Field Values

PTP

public static final byte PTP
Indicates that the link type the interface is connected to is point-to-point.

See Also:
Constant Field Values

BROADCAST

public static final byte BROADCAST
Indicates that the link type the interface is connected to is broadcast.

See Also:
Constant Field Values

NBMA

public static final byte NBMA
Indicates that the link type the interface is connected to is non broadcast multi access.

See Also:
Constant Field Values

PTM

public static final byte PTM
Indicates that the link type the interface is connected to is point-to-multipoint.

See Also:
Constant Field Values

VL

public static final byte VL
Indicates that the link type the interface is connected to is virtual-link.

See Also:
Constant Field Values

id

public java.lang.Integer id
The Interface id. Used to determine the "real" Interface associated with this one.


networkType

public byte networkType
The network type the interface is connected to (ptp, broadcast, nbma, ptm).


ipaddr

public int ipaddr
The ip address of the interface.


ipmask

public int ipmask
The ip mask of the Interface.


state

public int state
The actual state of the Interface (down, loopback, waiting,...)


rtrnh

public java.lang.String rtrnh
A reference to the nh of the OSPF session above


as_nh

public java.lang.String as_nh
A reference to the as_nh of the OSPF session above


cost

public int cost
cost of this interface


desigRouter

public int desigRouter
The Designated Router for the network to which the interface is attached.


backupDesigRouter

public int backupDesigRouter
The Backup Designated Router for the network to which the interface is attached.


neighbors

public java.util.HashMap neighbors
A list of neighbor data structures containing information about the relationship to the neighbors.


routerPrio

public int routerPrio
Priority of the router the interface is attached to.


myOSPF

public OSPF myOSPF
A link to the OSPF ProtocolSession this Interface belongs to.


myArea

public AreaData myArea
A link to the Area Data Structure this Interface belongs to. Can change when the Area is reconfigured.


lsAckContent

public LS_AckPacket lsAckContent
The content of an LS Ack Packet. This is used to accumulate several LSA Headers to be acknowledged in the next delAckTime seconds.


pacingLSAList

public java.util.HashMap pacingLSAList
A list of LSAs that must be flooded out this interface, but are not allowed to send out immediately due to the PacingTimer. It is implemented as HashMap because it should be easy to replace old instances of LSAs by new ones.


transDelay

public int transDelay
The seconds by which LSAs exiting the interface will have their age incremented.


helloInterval

public int helloInterval
The period, in seconds, between transmissions of Hello packets on the interface.


routerDeadInterval

public int routerDeadInterval
The period, in seconds, that the router will wait to hear a Hello from a neighbor on the network to which the interface is connected before declaring the neighbor down.


rxmtInterval

public long rxmtInterval
The period, in seconds, the router will wait between retransmissions of OSPF-Packets that have not been acknowledged.


delAckTime

public long delAckTime
The interval in seconds the router will wait before it sends an delayed Acknowledgment to all Neighbors of this Interface. This value should be less than rxmtInterval!


waitTimer

public Interface.BeforeElectionTimer waitTimer
A Wait Timer which will wait for routerDeadInterval seconds before either beginning an election of DR and BDR, or receiving an incoming Hello Packet which advertises DR and BDR.


helloTimer

public Interface.SendNewHelloTimer helloTimer
A timer that is set to helloInterval. When it expires, a Hello Packet is transmitted from this Interface.


ackTimer

public Interface.DelayedAckTimer ackTimer
A timer that delays sending of Acknowledgment Packets. When it expires, it send an Acknowledgment Packet with all LSA Headers filled in during its run time to all Neighbors of this Interface.


pacingTimer

public Interface.PacingTimer pacingTimer
A timer that controls the rate at which LS Update packets are transmitted out this interface. It guaratees that not every single LSA is sent out in a separate LS Update packet.

Constructor Detail

Interface

public Interface(OSPF myOSPF,
                 AreaData myArea,
                 com.renesys.raceway.DML.Configuration cfg)
Constructs a new Interface.

Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure the OSPF interface parameters at the start and during the run by configUpdateMessage. Supported DML attributes are:
 if [
      # The interface's ID (equal to the id of the according NIC)
      # mandatory!
      id      %I
      
      # This can be used to configure multiple interfaces at once
      idrange [from %I1! to %I1!] # idrange not impl. yet!!!

      # The link type of the network connected to this interface
      # (possible values: "ptp", "broadcast", "nbma", "ptm", "vlink")
      # all values but "ptp" not supported!!!
      # mandatory!
      network             %S

      # The interface output cost.
      # optional! default value: 1
      cost                %I
            
      # The router priority.
      # optional! default value: 0
      priority            %I
         
      # InfTransDelay
      # optional! default value: 1
      transmit-delay      %I
            
      # HelloInterval
      # optional! default value: 10
      hello-interval      %I
            
      # RouterDeadInterval
      # optional! default value: 40
      dead-interval       %I
            
      # RxmtInterval
      # optional! default value: 5
      retransmit-interval %I
    ]
 

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Parameters:
cfg - contains the values for configurable ospf interface parameters
Throws:
com.renesys.raceway.DML.configException - if any of the calls to findSingle throws such an exception.

configRest

public void configRest(java.util.Enumeration peers)
                throws com.renesys.raceway.DML.configException
Additional configuration to the interface. Configure IP address, IP mask and the ospf neighbors and check the configured network type.

Parameters:
peers - Enumeration of NIC's which are peers to this interface.
Throws:
com.renesys.raceway.DML.configException - thrown if configured linkType does not match the link layer found in the corresponding NIC.

init

public void init()
Start the ospf session on this interface (just call method "interfaceUp()"). Also used when restarting ospf.


reset

public void reset()
Reset the Interface Data Structure. That means stop all Timers and reset all Neighbor Data Structures. This is part of the stop process of the OSPF Session.


setArea

public void setArea(AreaData newArea)
When this Interface changes its Area, this method should be called to set the links to the Area Data Structure to the new Area.


receivedHello

public void receivedHello(Packet helloPkt,
                          int sourceIP)
When the Area Data Structure above gets a Hello Packet, it will call this method of the ospf interface which is associated with the NIC on which the packet has come in. helloReceived then further process the packet.


receivedDDPacket

public void receivedDDPacket(Packet dataDescPkt,
                             java.lang.Integer sourceIP)
                      throws ProtocolException
When the Area Data Structure, this Interface belongs to, gets a Database Description Packet, it will call this method to further process it. A decision is made here, which event should be triggered on the Neighbor State Machine.

ProtocolException

receivedLSRequest

public void receivedLSRequest(Packet lsReqPkt,
                              java.lang.Integer sourceIP)
When the Area Data Structure of this Interface gets a Link State Request Packet it calls this method to further process the Packet.


receivedLSUpdate

public void receivedLSUpdate(Packet lsUpdPkt,
                             java.lang.Integer sourceIP)
When the Area Data Structure, this Interface belongs to, gets a Link State Update Packet it calls this method to further process the Packet.


receivedLSAck

public void receivedLSAck(Packet lsAckPkt,
                          java.lang.Integer sourceIP)
When the Area Data Structure, this Interface belongs to, gets a Link State Acknowledgment Packet it calls this method to further process the Packet.


clearLSAFromRetrLists

public void clearLSAFromRetrLists(java.lang.String key)
clears a particular LSA from every Neighbors link state retransmission list. If the List becomes therefore empty, stop the FloodingTimer of the Neighbor Data Structure.


delayedAcknowledge

public void delayedAcknowledge(LSA ackLSA)
called if a new LSA should be delayed acknowledged. Build a new LS Ack Packet and set the ackTimer, or add the Header of ackLSA to an existing LS Ack Packet.


loopInd

public void loopInd()
Used by Lower-level protocols and network management to indicate that the network interface is now looped back to itself.


unloopInd

public void unloopInd()
Used by Lower-level protocols and network management to indicate that the network interface is no longer looped back to itself.


interfaceUp

public void interfaceUp()
Used by the Area Data Structure this Interface belongs to. It enables the Interface to run OSPF. In particular, determine state of Interface, start the Hello Timer enabling periodic sending of Hello Packets.


interfaceDown

public void interfaceDown()
Used by Lower-level protocols to indicate that the network interface is no longer functional.


killNeighbor

public void killNeighbor(int ipaddress)
Used to destroy a neighbor connection associated with the interface. The neighbor is identified by the ip address of its interface.

Parameters:
ipaddress - contains the ip address of the neighbors interface.

toString

public java.lang.String toString()
Converts the Interface to a string. You can also use the briefer format toMinString.

Overrides:
toString in class java.lang.Object

printConfiguration

public void printConfiguration()
print current configuration of the interface if necessary. That means if configuration has changed since last print and one of the following ospf options are set: "show_interfaces", "show_config", "show_all".


toMinString

public java.lang.String toMinString(boolean usenhi)
Converts the interface to a string using a briefer format than toString.

Parameters:
usenhi - Whether or not to use NHI addressing when possible.
Returns:
the interface in minimal string format

toMinString

public java.lang.String toMinString()
Converts the interface to a string using a briefer format than toString.

Returns:
the interface in minimal string format