SSF.OS.OSPF
Class sOSPF

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.OS.OSPF.sOSPF
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable, FIBChangeListener

public class sOSPF
extends ProtocolSession
implements FIBChangeListener

The OSPF interior gateway protocol (IGP).


Field Summary
static int ADJACENT
          Indicates that an adjacency exists with a given neighbor.
static int AREA_BORDER
          Indicates an OSPF area border router.
 boolean area_border_rtr
          Indicates if this is an area border router.
 int area_num
          The Area to which this router belongs.
 int[] areas
          The Area(s) to which this route belongs.
static int AS_BOUNDARY
          Indicates an OSPF AS boundary router.
 boolean as_boundary_rtr
          Indicates if this is an AS boundary router.
 java.lang.String as_nh
          The NHI address prefix of the AS to which this router belongs.
 int as_num
          The number of the AS to which this router belongs.
static int ASPF_MCAST_ADDR
          The int value of the multicast address for ALLSPFRouters (All Shortest Path First Routers).
static int BACKBONE
          Indicates an OSPF backbone router.
 boolean backbone_rtr
          Indicates if this is a backbone router.
static double BUILD_RT_TABLE_ITVL
          The interval at which OSPF rebuilds its routing tables.
 Debug debug
          A helper to manage debugging.
static int DESIG_MCAST_ADDR
           
static int DOWN
          Indicates that a given neighbor is down.
 RoutingTable fwd_table
          The local router's forwarding table.
static double GET_RT_TYPE_ITVL
          The interval at which OSPF determines the router types.
static double HELLO_INTERVAL
          The interval at which OSPF sends hello packets.
static int HELLO_RCVD
          Indicates that a hello has been received from a given neighbor.
 int hostid
          The host ID of the local router.
 Interface[] ifs
          The OSPF interface data structure.
static int INTERNAL
          Indicates an internal OSPF router.
 boolean internal_rtr
          Indicates if this is an internal Router.
 LSDatabase lsdb
          The link state database implemented as an adjacency list.
 java.lang.String nh
          The NHI address prefix of the local router.
static int POINT_TO_POINT
          Indicates a point-to-point connection to another router.
static double SEND_LSA_ITVL
          The interval at which OSPF sends LSAs.
static int TO_AS_BOUNDARY
          Indicates a connection to an AS boundary router.
static int TO_HOST
          Indicates a connection to a host.
static int TO_STUB
          Indicates a connection to a stub network.
static int TO_TRANSIT
          Indicates a connection to a transit network.
static Net topnet
          A reference to the top-level Net.
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
sOSPF()
          Constructs an OSPF protocol session.
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure this ProtocolSession.
 void createLinkDatabase()
          Queries the list of all routers and links from Net, decides connection types, and creates a link state database.
 float getSimTime()
          Get the current simulation.
 void init()
          Initialization routine called by ProtocolGraph after instantiation.
 double nowsec()
          Returns the current simulation time in seconds.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession.
 void routeAddedBy(RoutingInfo rinfo, java.lang.String protocolName)
          Notification that the named protocol has added a new entry to the forwarding table on this host.
 void routeDeletedBy(RoutingInfo rinfo, java.lang.String protocolName)
          Notification that the named protocol has removed an entry from the forwarding table on this host.
 
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

INTERNAL

public static final int INTERNAL
Indicates an internal OSPF router.

See Also:
Constant Field Values

AREA_BORDER

public static final int AREA_BORDER
Indicates an OSPF area border router.

See Also:
Constant Field Values

BACKBONE

public static final int BACKBONE
Indicates an OSPF backbone router.

See Also:
Constant Field Values

AS_BOUNDARY

public static final int AS_BOUNDARY
Indicates an OSPF AS boundary router.

See Also:
Constant Field Values

GET_RT_TYPE_ITVL

public static final double GET_RT_TYPE_ITVL
The interval at which OSPF determines the router types.

See Also:
Constant Field Values

HELLO_INTERVAL

public static final double HELLO_INTERVAL
The interval at which OSPF sends hello packets.

See Also:
Constant Field Values

SEND_LSA_ITVL

public static final double SEND_LSA_ITVL
The interval at which OSPF sends LSAs.

See Also:
Constant Field Values

BUILD_RT_TABLE_ITVL

public static final double BUILD_RT_TABLE_ITVL
The interval at which OSPF rebuilds its routing tables.

See Also:
Constant Field Values

DOWN

public static final int DOWN
Indicates that a given neighbor is down.

See Also:
Constant Field Values

HELLO_RCVD

public static final int HELLO_RCVD
Indicates that a hello has been received from a given neighbor.

See Also:
Constant Field Values

ADJACENT

public static final int ADJACENT
Indicates that an adjacency exists with a given neighbor.

See Also:
Constant Field Values

POINT_TO_POINT

public static final int POINT_TO_POINT
Indicates a point-to-point connection to another router.

See Also:
Constant Field Values

TO_TRANSIT

public static final int TO_TRANSIT
Indicates a connection to a transit network.

See Also:
Constant Field Values

TO_STUB

public static final int TO_STUB
Indicates a connection to a stub network.

See Also:
Constant Field Values

TO_AS_BOUNDARY

public static final int TO_AS_BOUNDARY
Indicates a connection to an AS boundary router.

See Also:
Constant Field Values

TO_HOST

public static final int TO_HOST
Indicates a connection to a host.

See Also:
Constant Field Values

ASPF_MCAST_ADDR

public static final int ASPF_MCAST_ADDR
The int value of the multicast address for ALLSPFRouters (All Shortest Path First Routers). The real IP address is 224.0.0.5, but here we will use Integer.MAX_VALUE - 10.

See Also:
Constant Field Values

DESIG_MCAST_ADDR

public static final int DESIG_MCAST_ADDR
See Also:
Constant Field Values

topnet

public static Net topnet
A reference to the top-level Net.


hostid

public int hostid
The host ID of the local router.


nh

public java.lang.String nh
The NHI address prefix of the local router.


internal_rtr

public boolean internal_rtr
Indicates if this is an internal Router.


area_border_rtr

public boolean area_border_rtr
Indicates if this is an area border router.


backbone_rtr

public boolean backbone_rtr
Indicates if this is a backbone router.


as_boundary_rtr

public boolean as_boundary_rtr
Indicates if this is an AS boundary router.


as_nh

public java.lang.String as_nh
The NHI address prefix of the AS to which this router belongs.


as_num

public int as_num
The number of the AS to which this router belongs.


area_num

public int area_num
The Area to which this router belongs.


areas

public int[] areas
The Area(s) to which this route belongs. A router can belong to at most 2 areas, ie, the backbone and a non-backbone area.


ifs

public Interface[] ifs
The OSPF interface data structure.


lsdb

public LSDatabase lsdb
The link state database implemented as an adjacency list.


fwd_table

public RoutingTable fwd_table
The local router's forwarding table.


debug

public Debug debug
A helper to manage debugging.

Constructor Detail

sOSPF

public sOSPF()
Constructs an OSPF protocol session.

Method Detail

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Description copied from class: ProtocolSession
Configure this ProtocolSession.

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class ProtocolSession
com.renesys.raceway.DML.configException

routeAddedBy

public void routeAddedBy(RoutingInfo rinfo,
                         java.lang.String protocolName)
Notification that the named protocol has added a new entry to the forwarding table on this host.

Specified by:
routeAddedBy in interface FIBChangeListener
Parameters:
rinfo - Information about the route added to the FIB.
protocolName - The name of the protocol that added the route.

routeDeletedBy

public void routeDeletedBy(RoutingInfo rinfo,
                           java.lang.String protocolName)
Notification that the named protocol has removed an entry from the forwarding table on this host.

Specified by:
routeDeletedBy in interface FIBChangeListener
Parameters:
rinfo - Information about the route deleted from the FIB.
protocolName - The name of the protocol that deleted the route.

init

public void init()
Initialization routine called by ProtocolGraph after instantiation. Information that OSPF needs in the setup stage include: 1. a reference to the IP protocol 2. a reference to the router in which this OSPF sits 3. the level numbers of the router, which says which AS and area this router is in

Overrides:
init in class ProtocolSession

nowsec

public double nowsec()
Returns the current simulation time in seconds.

Returns:
the current simulation time in seconds

createLinkDatabase

public void createLinkDatabase()
Queries the list of all routers and links from Net, decides connection types, and creates a link state database.


push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Description copied from class: ProtocolSession
Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession. The pusher sends a reference to itself in the second argument. This push happens immediately, without any simulation time elapsing, regardless of other activities taking place in the ProtocolGraph.

If you desire "safe" interaction with other CPU activities, even though your push() consumes no measurable/modelable CPU cycles, define the "cpudelay true" attribute for the ProtocolGraph and use pushAfterDelay(message,fromSession,0.0). This will guarantee proper ordering; that is, the framework will wait until the CPU is free before proceeding with the requested push().

Specified by:
push in class ProtocolSession
ProtocolException

getSimTime

public float getSimTime()
Get the current simulation.