SSF.OS
Class IP

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

public class IP
extends ProtocolSession
implements com.renesys.raceway.DML.Configurable

This class implements a subset of the IP protocol. The primary job of IP is to find a route for each datagram and send it on its way. In order to allow gateways or other intermediate systems to forward the datagram, it adds its own header (IpHeader.java). This version of IP uses a 'next hop' IP address as a surrogate hardware address; future alternatives with more elaborate link layer models will fix this.

 Revisions ato 9/24/00: support for configuration of Monitors.
 Revisions jhc 1/29/01: support for ICMP messages before drop()
 

See Also:
IpHeader

Nested Class Summary
protected  class IP.demux_cache
          demux_cache: class internal to IP, used for rapid demultiplexing of protocol numbers to protocol session instances.
 
Field Summary
 int INTERFACE_COUNT
           
 NIC[] INTERFACE_SET
           
 int INTERFACE_SET_STARTING_SIZE
           
 java.util.Vector INTERFACES
          An array of NIC(s) controlled by this IP.
protected  RoutingTable ROUTING_TABLE
          The IP routing table.
protected  IP.demux_cache session_cache
           
protected  java.lang.String tieBreakerClass
           
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
IP()
           
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure this IP session.
 void drop(IpHeader pkt)
          Method called when IP drops a packet that has reached the end of its lifetime, or has no route to its destination.
 boolean getMonitorEnable()
          An ProtocolMonitor may inquire if IP calls to its receive() are enabled
 RoutingTable getRoutingTable()
          Return the IP routing table.
 void init()
          Monitor may need to initialize after the config() phase.
 void opened(ProtocolSession nic)
          Called by a neighboring session to confirm to this session that an open operation has succeeded, and that this session is now successfully configured over/under the caller session.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession.
 void setGraph(ProtocolGraph G)
          Set the protocol graph in which this session is configured.
 void setMonitorEnable(boolean en)
          An ProtocolMonitor may turn on and off calls to its receive() method.
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, debugIdentifier, inGraph, open, pushAfterDelay, pushAfterDelayFailed, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERFACES

public java.util.Vector INTERFACES
An array of NIC(s) controlled by this IP.


ROUTING_TABLE

protected RoutingTable ROUTING_TABLE
The IP routing table.


session_cache

protected IP.demux_cache session_cache

INTERFACE_SET_STARTING_SIZE

public final int INTERFACE_SET_STARTING_SIZE
See Also:
Constant Field Values

INTERFACE_SET

public NIC[] INTERFACE_SET

INTERFACE_COUNT

public int INTERFACE_COUNT

tieBreakerClass

protected java.lang.String tieBreakerClass
Constructor Detail

IP

public IP()
Method Detail

getRoutingTable

public RoutingTable getRoutingTable()
Return the IP routing table.


setGraph

public void setGraph(ProtocolGraph G)
              throws ProtocolException
Description copied from class: ProtocolSession
Set the protocol graph in which this session is configured.

Overrides:
setGraph in class ProtocolSession
Throws:
ProtocolException - if the session is already configured in a protocol graph

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure this IP session. Example of the supported DML attributes:
   ProtocolSession [for ip use SSF.OS.IP
     debug   %S    # print verbose diagnostics, true/false

     tiebreaker [
       use   %S    # class name to use to choose routes of equal cost
     ]

     monitor [
       use   %S    # class name to use for IP Monitoring
     ]
   ]
 
If tiebreaker is omitted, the default is a simple hash on src and dest address provided in an anonymous inner class in SSF.Net.RadixTreeRoutingTable.

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

init

public void init()
          throws ProtocolException
Monitor may need to initialize after the config() phase.

Overrides:
init in class ProtocolSession
ProtocolException

setMonitorEnable

public void setMonitorEnable(boolean en)
An ProtocolMonitor may turn on and off calls to its receive() method. NOTE: the ProtocolMonitor MUST explicitely set enableMonitor(true) in its init() method to begin receiving IP packets.


getMonitorEnable

public boolean getMonitorEnable()
An ProtocolMonitor may inquire if IP calls to its receive() are enabled


opened

public void opened(ProtocolSession nic)
            throws ProtocolException
Description copied from class: ProtocolSession
Called by a neighboring session to confirm to this session that an open operation has succeeded, and that this session is now successfully configured over/under the caller session.

Overrides:
opened in class ProtocolSession
Throws:
ProtocolException - if the opened session could not be added to the list of open sessions, perhaps because the max session count has been exceeded

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

drop

public void drop(IpHeader pkt)
Method called when IP drops a packet that has reached the end of its lifetime, or has no route to its destination.