SSF.OS
Class IP

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

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
private  boolean DEBUG
           
 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  ProtocolMonitor monitor
           
private  boolean monitorON
           
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
inGraph, name, use
 
Constructor Summary
IP()
           
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure this IP session.
private  void createMonitor(com.renesys.raceway.DML.Configuration config)
          Instantiate and configure an IP packet monitor implementing the interface SSF.OS.ProtocolMonitor, if specified locally in this host's IP configuration.
 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)
           
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
           
 void setGraph(ProtocolGraph G)
           
 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

DEBUG

private boolean DEBUG

tieBreakerClass

protected java.lang.String tieBreakerClass

monitor

protected ProtocolMonitor monitor

monitorON

private boolean monitorON
Constructor Detail

IP

public IP()
Method Detail

getRoutingTable

public RoutingTable getRoutingTable()
Return the IP routing table.


setGraph

public void setGraph(ProtocolGraph G)
              throws ProtocolException
Overrides:
setGraph in class ProtocolSession
ProtocolException

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

createMonitor

private void createMonitor(com.renesys.raceway.DML.Configuration config)
                    throws com.renesys.raceway.DML.configException
Instantiate and configure an IP packet monitor implementing the interface SSF.OS.ProtocolMonitor, if specified locally in this host's IP configuration.

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
Overrides:
opened in class ProtocolSession
ProtocolException

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
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.