SSF.OS.NetFlow
Class IpFlowCollector

java.lang.Object
  |
  +--SSF.OS.NetFlow.IpFlowCollector
All Implemented Interfaces:
ProtocolMonitor
Direct Known Subclasses:
IpFlowCollectorWD

public class IpFlowCollector
extends java.lang.Object
implements ProtocolMonitor

Monitor that collects flows of record type: "SSF.OS.NetFlow" Revised from IpFlowCollector, give "domain information" in flow records.

In the future, it may be used to replace IpFlowCollector completely.


Field Summary
static byte ALL_PROTOCOLS
          default value for protocol_type: all protocols
protected  Timer checkTableTimer
          timer, check the open connection table when fired
protected  java.util.LinkedList conFinishList
          List of finished connections
protected  IpFlowTable conOpenTable
          table of open connections
protected  int dataTypeCode
          the datatype code (used when sending data to stream)
protected  boolean debug
          debug switch
protected  byte dstMask
          the suffix desination IP mask
protected  Timer dumpTimer
          timer, periodically dump the conFinishList to a file
protected  int hostCode
          the host code (used when sending data to stream)
protected  int initCapacity
          init open table capacity
protected  IP ipSess
          the ip session it's related
protected  short LOCAL
           
protected  java.lang.Class nicClass
          the NIC class used to in receive function
 byte protocol_type
          protocol interested in
protected  java.lang.Class protocolMsgTypeClass
          used to check the type of the message, now just used for BGP
protected  byte srcMask
          the suffix source IP mask
static java.lang.String STREAM_TYPE
           
 
Constructor Summary
IpFlowCollector()
          default constructor, does nothing
 
Method Summary
 void config(ProtocolSession ownerProtocol, com.renesys.raceway.DML.Configuration cfg)
          config the collector MUST be called before run the collector debug -- debug switch: true/false protocol_type -- the protocol that is interested.
 float getSimTime()
          getSimTime: get the simulation time it's the same function used in tcpSessionMaster.java
 ProtocolGraph inGraph()
          inGraph
 void init()
          allocate memory for tables init the "theStream" recorder start the timers.
protected  boolean isOldConnection(NetFlow nflow, float curTime)
          judge whether this connection is long-last/inactive
 void receive(ProtocolMessage packet, ProtocolSession fromSession, ProtocolSession toSession)
          receive filt the IpPacket, collect the statistical values of the interested protocol
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STREAM_TYPE

public static java.lang.String STREAM_TYPE

debug

protected boolean debug
debug switch


ipSess

protected IP ipSess
the ip session it's related


ALL_PROTOCOLS

public static final byte ALL_PROTOCOLS
default value for protocol_type: all protocols

See Also:
Constant Field Values

protocol_type

public byte protocol_type
protocol interested in


conOpenTable

protected IpFlowTable conOpenTable
table of open connections


initCapacity

protected int initCapacity
init open table capacity


conFinishList

protected java.util.LinkedList conFinishList
List of finished connections


dumpTimer

protected Timer dumpTimer
timer, periodically dump the conFinishList to a file


checkTableTimer

protected Timer checkTableTimer
timer, check the open connection table when fired


dataTypeCode

protected int dataTypeCode
the datatype code (used when sending data to stream)


hostCode

protected int hostCode
the host code (used when sending data to stream)


srcMask

protected byte srcMask
the suffix source IP mask


dstMask

protected byte dstMask
the suffix desination IP mask


nicClass

protected java.lang.Class nicClass
the NIC class used to in receive function


protocolMsgTypeClass

protected java.lang.Class protocolMsgTypeClass
used to check the type of the message, now just used for BGP


LOCAL

protected final short LOCAL
See Also:
Constant Field Values
Constructor Detail

IpFlowCollector

public IpFlowCollector()
default constructor, does nothing

Method Detail

config

public void config(ProtocolSession ownerProtocol,
                   com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
config the collector MUST be called before run the collector

Specified by:
config in interface ProtocolMonitor
com.renesys.raceway.DML.configException

init

public void init()
allocate memory for tables init the "theStream" recorder start the timers.

Specified by:
init in interface ProtocolMonitor

receive

public void receive(ProtocolMessage packet,
                    ProtocolSession fromSession,
                    ProtocolSession toSession)
receive filt the IpPacket, collect the statistical values of the interested protocol

Specified by:
receive in interface ProtocolMonitor
Parameters:
packet - received ipPacket
fromSession - the Protocol session from which this packet is received.
toSession - the Protocol session to which this packet will be pushed to.

getSimTime

public float getSimTime()
getSimTime: get the simulation time it's the same function used in tcpSessionMaster.java


inGraph

public ProtocolGraph inGraph()
inGraph


isOldConnection

protected boolean isOldConnection(NetFlow nflow,
                                  float curTime)
judge whether this connection is long-last/inactive

Parameters:
curTime - current time