SSF.OS.TCP
Class tcpSessionMaster

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

public class tcpSessionMaster
extends ProtocolSession

This class manages all the TCP sessions, such as creating a new TCP session and closing an existing TCP session. It receives messages coming from the upper level protocol and lower level protocol, demultiplex them and pass them to the corresponding TCP sessions according to different IP address and port number.


Field Summary
static short DELACK
          flag for delayed-ack option
static short FAST_RECOVERY
          flag for fast recovery option
 long init_time
          random initial ofset of the system clock
 long ISS
          initial send sequence number
 long ISS_INCR
          initial send sequence number increment
 int MaxConWnd
          maximum congestion window size
 long MaxIdleTime
          TCP maximum idle time, seconds
 int MaxRexmitTimes
          maximum retransmission times
 long MSL
          TCP maximum segment lifetime, seconds
 int MSS
          maximum segment size, bytes
 int RcvWndSize
          receive window size, MSS units
 int SendBufferSize
          send buffer size, MSS units
 int SendWndSize
          send window size, MSS units
 long TCP_FAST_INTERVAL
          TCP fast timer interval, seconds
 long TCP_SLOW_INTERVAL
          TCP slow timer interval, seconds
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
tcpSessionMaster()
          Constructors
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure the TCP parameters.
 tcpSession FindServer(int srcPort)
          Find the listening (server) tcpSession bound to the given local port number.
 tcpSession FindSession(int srcPort, int DesIpAdr, int DesPort)
          Find a session in the TCP session list by its identification via source port number, destination IP address and port number.
 int getSessionID()
          Returns the next higher automatically assigned integer session number.
 void init()
          initialize the tcpSessionMaster: get references to Socket session and IP session in enclosing ProtocolGraph.
 void open(ProtocolSession higher, java.lang.Object request)
          No-op, for conformance with ProtocolSession interface.
 void openConnect(ProtocolSession higher, int SrcIpAddr, int SrcPort, int DesIpAddr, int DesPort)
          Actively open a connection.
 boolean opened(int SrcPort, int DesIpAddr, int DesPort)
          Find if the connection has been already established.
 void openServer(ProtocolSession higher, int SrcIpAddr, int SrcPort)
          Passive open of a listening server session.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Demoltiplex the arriving TCP/IP message to its tcpSession session in the protocol graph.
 void removeConnect(tcpSession tobeRemoved)
          remove the connection from the connection list
 void removeServer(int SrcIpAddr, int SrcPort)
          Remove a pasive server session listening on local port SrcPort.
 void respond(int srcIpAddr, int desIpAddr, int srcPort, int desPort, int win, long seqNo, long ackNo, byte flag, int seglen)
          Send a TCP message with given header fields, and seglen virtual payload bytes.
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, debugIdentifier, inGraph, 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

init_time

public long init_time
random initial ofset of the system clock


ISS

public long ISS
initial send sequence number


ISS_INCR

public long ISS_INCR
initial send sequence number increment


MSS

public int MSS
maximum segment size, bytes


RcvWndSize

public int RcvWndSize
receive window size, MSS units


SendWndSize

public int SendWndSize
send window size, MSS units


SendBufferSize

public int SendBufferSize
send buffer size, MSS units


MaxConWnd

public int MaxConWnd
maximum congestion window size


MaxRexmitTimes

public int MaxRexmitTimes
maximum retransmission times


TCP_SLOW_INTERVAL

public long TCP_SLOW_INTERVAL
TCP slow timer interval, seconds


TCP_FAST_INTERVAL

public long TCP_FAST_INTERVAL
TCP fast timer interval, seconds


MSL

public long MSL
TCP maximum segment lifetime, seconds


MaxIdleTime

public long MaxIdleTime
TCP maximum idle time, seconds


DELACK

public static short DELACK
flag for delayed-ack option


FAST_RECOVERY

public static short FAST_RECOVERY
flag for fast recovery option

Constructor Detail

tcpSessionMaster

public tcpSessionMaster()
Constructors

Method Detail

getSessionID

public int getSessionID()
Returns the next higher automatically assigned integer session number. beginning from 0. Used to distinguish multiple tcpSessions in Instrumentation monitoring.


init

public void init()
          throws ProtocolException
initialize the tcpSessionMaster: get references to Socket session and IP session in enclosing ProtocolGraph.

Overrides:
init in class ProtocolSession
ProtocolException

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Configure the TCP parameters. Supported DML attributes are:
 ProtocolSession [name tcp use SSF.OS.TCP.tcpSessionMaster
   tcpinit[
     ISS               %I    # initial sequence number
     MSS               %I    # maximum segment size, bytes
     RcvWndSize        %I    # receive buffer size in units of MSS
     SendWndSize       %I    # maximum send window size in units of MSS
     SendBufferSize    %I    # send buffer size in units of MSS
     MaxConWnd         %I    # maximum congestion window size in units of MSS
     MaxRexmitTimes    %I    # maximum number of retransmissions
     TCP_SLOW_INTERVAL %F    # granularity of TCP slow timer, sec
     TCP_FAST_INTERVAL %F    # granularity of TCP fast(delay-ack), sec
     MSL               %F    # maximum segment lifetime, sec
     MaxIdleTime       %F    # maximum idle time, sec
     delayed_ack       %S    # delayed ack option, true/false
     fast_recovery     %S    # use fast recovery algorithm, true/false
     show_report       %S    # print summary connection report, true/false
   ]

   debug    %S               # if true, dump verbose TCP diagnostics to files
                             # for session & host (see below), true/false

   warn     %S               # if true, prints warnings about certain
                             # important TCP events and errors (default: true)

   # dump filename prefixes - actual filenames end with "_hostID_flowID.out"
   # for session info, and with "_hostID.out" for host info
   rttdump   %S              # rtt dumpfile prefix  (session)
   cwnddump  %S              # cwnd dumpfile prefix (session)
   rexdump   %S              # rexmit timer dumpfile prefix (session)
   eventdump %S              # dumpfile prefix for all events (session)
   con_count %S              # dumpfile prefix for number of connections (host)
   rto_count %S              # dumpfile prefix for timeout info (host)
 ]
 

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

open

public void open(ProtocolSession higher,
                 java.lang.Object request)
          throws ProtocolException
No-op, for conformance with ProtocolSession interface.

Overrides:
open in class ProtocolSession
Throws:
ProtocolException - if neither the opening session nor the opened session are contained within a valid protocol graph, or if they are already contained within different protocol graphs, or if the opening session could not be added to the list of open sessions, perhaps because the max session count has been exceeded

openServer

public void openServer(ProtocolSession higher,
                       int SrcIpAddr,
                       int SrcPort)
Passive open of a listening server session.


removeServer

public void removeServer(int SrcIpAddr,
                         int SrcPort)
Remove a pasive server session listening on local port SrcPort. [BJP 2002.01.17]


FindServer

public tcpSession FindServer(int srcPort)
Find the listening (server) tcpSession bound to the given local port number.

Returns:
tcpSession representing this server if the server exist, otherwise return null

openConnect

public void openConnect(ProtocolSession higher,
                        int SrcIpAddr,
                        int SrcPort,
                        int DesIpAddr,
                        int DesPort)
Actively open a connection.


opened

public boolean opened(int SrcPort,
                      int DesIpAddr,
                      int DesPort)
Find if the connection has been already established.


FindSession

public tcpSession FindSession(int srcPort,
                              int DesIpAdr,
                              int DesPort)
Find a session in the TCP session list by its identification via source port number, destination IP address and port number.


removeConnect

public void removeConnect(tcpSession tobeRemoved)
remove the connection from the connection list

Parameters:
tobeRemoved - tcpSession which represent this connection

respond

public void respond(int srcIpAddr,
                    int desIpAddr,
                    int srcPort,
                    int desPort,
                    int win,
                    long seqNo,
                    long ackNo,
                    byte flag,
                    int seglen)
             throws ProtocolException
Send a TCP message with given header fields, and seglen virtual payload bytes. Used to send RESET signal.

ProtocolException

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Demoltiplex the arriving TCP/IP message to its tcpSession session in the protocol graph.

If the destination tcpSession can be found, then put the message to the receive buffer, otherwise, check the flag of TCP header, and if it's a connection request, then find the server socket by port number and create a new tcpSession for this connection.

Specified by:
push in class ProtocolSession
ProtocolException